import Cookies from 'js-cookie'

const TokenKey = 'loginToken'

export function getToken() {
    return window.localStorage.getItem("token");
}

export function setToken(token) {
    return window.localStorage.setItem("token", token);
}

export function removeToken() {
    return Cookies.remove(TokenKey)
}

export function setUserInfo(userInfo) {
    return Cookies.set(userInfo.id, userInfo);
}

export function geUserInfoById(id) {
    return Cookies.get(id)
}

export function removeUserInfoById(id) {
    return Cookies.remove(id)
}
